import { Context, Next } from 'koa';  // 导入 Koa 的类型

// 全局中间件
export const globalMiddleware = async (ctx: Context, next: Next) => {
    ctx.return = (success: boolean, message?: string, data?: any) => {
        ctx.body = { success, message, data };
    };

    await next();
}